On 7/19/12 1:17 AM, Ronald Chmara wrote:
With PHP 6, lets start with a:
Pure
Object
Oriented
PHP
OMG, did you seriously just recommend POOP? LOL, I'm gonna go die now.
-- Dante
D. Dante Lorenso
da...@lorenso.com
972-333-4139
--
PHP Internals - PHP Runtime Development Mailing Li
On 4/20/11 9:55 AM, Mark wrote:
Hi,
This proposal is for the often called line like this:
$var = isset($_GET['var']) ? $_GET['var'] : '';
Only a shorter and imho a cleaner solution to get the same:
$var = varset($_GET['var']);
The implementation for this in PHP code is this:
# Arg 1 = the varia
The problem with implementing "ifsetor", "filled", or "??" in userland
is that the "not set" or "undefined" warning is fired before the
variable is passed to the underlying function/method.
Is it possible to add a modifier that turns off warnings for undefined
variables whenever that specific
empty() and we'd need some
other function similar to be the opposite of isset() if you wanted that
type of check. The proposed filled() will suit all my needs with great
satisfaction :-)
-- Dante
--
D. Dante Lorenso
da...@lorenso.com
972-333-4139
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Lukas Kahwe Smith wrote:
On 21.11.2009, at 22:29, Dante Lorenso wrote:
I would love to restate my recommendation for the function "filled".
Which is the opposite of "empty". Filled would accept a variable
number of arguments and return the first where empty evaluates a
tual filter extension. Even if it is
>> possible, this is not a pretty short and easier solution than :
>>
>> $var = (isset($var)) ? $var : 'default';
>
> The ternary isn't meant to solve the isset thing you are talking about.
> It is simply a shortcut to
ty(), it would do so without
throwing any notices:
$x = filled($y["maybe"], $obj->tryit, $z['a']['b']['c'], $default);
Would it be a timesaver and very useful? You bet! That was 2006. Good
luck getting anything changed.
-- Dante
--
D. Dante Lorenso
da...@lorenso.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
uot;include_php" which doesn't drop into HTML mode by default.
Then, have the CGI flag that enables PHP mode by default.
-- Dante
--
D. Dante Lorenso
da...@lorenso.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Tore B. Krudtaa wrote:
To D. Dante Lorenso:
Thanks for notifying me of:
http://digitarald.de/project/fancyupload/
But I would still like to see the upload hooks accessible from within a
standard PHP inst., which would give me more control of the upload progress as
well as more control in the
Tore B. Krudtaa wrote:
I would like to be able to use the upload hooks without installing the APC.
I would eventually like to be able to use those upload hooks using session
variables.
Maybe you can avoid the problem entirely. I was using the
uploadprogress PECL extension (which I believe al
Jani Taskinen wrote:
Paweł Stradomski kirjoitti:
W liście Rasmus Lerdorf z dnia poniedziałek, 21 lipca 2008:
It also isn't any shorter:
if(str_endswith($path,'.php'))
vs.
if(substr($path,-4)=='.php')
Only if comparing to a static string, but not for this case:
if (substr($path, -
Stefan Marr wrote:
Hi,
D. Dante Lorenso schrieb:
All,
I can imagine a case where you would want to box common functionality
into a trait and be able to use that trait as a class also. Will we
end up with a lot of classes like this?:
class SomeClass {
use SomeTrait;
}
What's wrong
All,
I can imagine a case where you would want to box common functionality
into a trait and be able to use that trait as a class also. Will we end
up with a lot of classes like this?:
class SomeClass {
use SomeTrait;
}
What's wrong with making all 'Class'es be 'Trait's and the only thing
Richard Quadling wrote:
But the issue of having the same php.ini for PHP5 and PHP6 (both are
php-isapi.ini) is a pain and stops me from playing with them together.
Can't you just configure PHP when you compile it with the following option:
./configure ...
--with-config-file-pa
Sara Golemon wrote:
Back on the topic of trying to write a 'filled' function in an
extension, I have run into trouble. I have declared a function as follows:
...
Unfortunately, $x now contains a 'pig' key and the non-existent $y has
been transformed into an object:
Short answer: No. What you're
Pierre wrote:
On Fri, 26 May 2006 15:45:19 -0500
[EMAIL PROTECTED] ("D. Dante Lorenso") wrote:
Back on the topic of trying to write a 'filled' function in an
extension, I have run into trouble. I have declared a function as
follows:
It is perfectly normal and desir
All,
Back on the topic of trying to write a 'filled' function in an
extension, I have run into trouble. I have declared a function as follows:
-- 8< 8< --
static
ZEND_BEGIN_ARG_INFO(all_args_prefer_ref, ZEND_SEND_PREFER_REF)
ZEND_END_ARG_INFO
Sara Golemon wrote:
Seems the order or left vs right assignment evaluation has changed
somehow recently in my upgrade to PHP 5.1.4. See the following code:
That's is indeed a quirk of a change in the way variables are
retreived/stored between 5.0 and 5.1.
Is it an unexpected BC break? In func
Internals,
Seems the order or left vs right assignment evaluation has changed
somehow recently in my upgrade to PHP 5.1.4. See the following code:
-- 8< 8< --
-- 8< 8< --
in PHP 5.0.5:
Array
(
[0] => 0
[1] => 1
All,
I use PostgreSQL 8.1.3 extensively. Currently all my PHP 5.1.4 code is using the pgsql extension to connect. My newer development code is connecting through the newer PDO/pgsql extension.
Is the PostgreSQL 8.1.4 SQL injection bug fix necessary if I've been well
behaved by passing *all
Jeff Moore wrote:
On May 16, 2006, at 7:28 PM, D. Dante Lorenso wrote:
I'm not familiar with this OOP concept from any other language.
Perhaps it exists, but if it doesn't, is there a reason why?
Its hard to find a major OO language that does not have
property/accessor method suppo
Jason Garber wrote:
CS> Does anyone apart from me wonder why we need to bloat the language for
CS> an obscure feature like this? Please take a step back, take a deep
CS> breath, count to 10 and that's *really* what the PHP community has been
CS> waiting for.
Please consider that not everyone d
Marcus Boerger wrote:
btw, i wonder where the people are that usually complain about my patches?
Is this finally something most people like?
Maybe you built a nuclear power plant.
Dante
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.
Jared Williams wrote:
http://us3.php.net/manual/en/function.xmlwriter-write-raw.php
Anyone know the status of this function, if it does what I
want, and what version I can start using it?
I originally requested it. http://pecl.php.net/bugs/bug.php?id=6267 . I think
it'll appear in 5.2,
http:/
I'm on the latest and greatest PHP 5.1.4. I can see the function I
think I want in the manual:
http://us3.php.net/manual/en/function.xmlwriter-write-raw.php
But the manual says it's only in CVS. I confirmed that I don't have it:
* Fatal error: Call to undefined function xmlwriter_write_
Andi Gutmans wrote:
I can take any feature in PHP and add features :)
Is that an offer ;-)? I've got a couple you can add, lol.
Dante
At 01:44 PM 5/12/2006, Jason Garber wrote:
Hello,
PHP implements many features, and skips many features. I think the
rule of thumb needs to be that if
Marcus Boerger wrote:
no, the compiler generates code that makes the executor generate the
variable and complain prior to performing the call.
The executor doesn't complain about unset variables prior to calling
functions by reference, so I was thinking it could be modified to also
not com
Antony Dovgal wrote:
On 12.05.2006 02:49, D. Dante Lorenso wrote:
* #define ZEND_SEND_BY_REF 1
This one is what you need.
I don't think it is. The variable did not exist before the function was
called and should STILL not exist afterwards. I believe when you pass
by reference
All,
Is there a way to define a function in an extension which would not
require a passed in variable to exist? In other words, can ZE be
modified to allow extensions to not trigger E_NOTICE warnings if an
unset variable is passed to a function which does not care if the var is
set?
I can
lem if it would still be needed after filled() is
implemented.
Do I have any power to call a vote on this?
Dante
D. Dante Lorenso wrote:
Dear Internals,
I'd like a white bikeshed, but until you can decide on a color, how
about we just build the bikeshed already. Please consider the
fol
Rasmus Lerdorf wrote:
D. Dante Lorenso wrote:
In my PHP zen world, empty() and filled() are friends. Ok, I've been
selling 'filled()' for a while now. Can we reverse the sell and try
this .. why SHOULDN'T filled() be added to the language?
Because it doesn't do enou
Rasmus Lerdorf wrote:
Not sure what you guys are talking about. ?: is on the roadmap.
-Rasmus
Ok. That has some signs of hope. What is ?: exactly, though. I
searched '?:' and yeah, good luck with that in documentation. It
doesn't smell like it supports all the specifics that 'filled()' d
Jochem Maas wrote:
point 1: regardless of how people think there should be an ifsetor()
in the engine - the devs don't so there wont be one.
Avvhggghh! Don't you just want to scream!
point 2: anything trying to implement this functionality in userspace
is a hack. (to stregethen that stanc
Rick Widmer wrote:
D. Dante Lorenso wrote:
No, that doesn't address the problem. See this:
print @ifsetor($x, $y, $z, "dante")."\n";
Usage of the shutup operator, @, in this context is a shameful coding
habit and hides too much:
print @ifsetor($x, fakefunct
Rick Widmer wrote:
D. Dante Lorenso wrote:
Eric,
This reply is too basic and is not the answer. The problem is more
complex then you have grasped.
function ifsetor() {
$args = func_get_args();
$count = count( $args );
for( $i=0; $i<$count; $i++ ) {
if isset( $args[
Dear Internals,
I'd like a white bikeshed, but until you can decide on a color, how
about we just build the bikeshed already. Please consider the following
specification:
== 8< 8< 8< ==
filled
(PHP 5.2.0)
filled - Find first non-em
Enjoy.
Eric Coleman
Eric Coleman
http://aplosmedia.com
home: 412 399 1024
cell: 412 779 5176
On May 3, 2006, at 3:13 AM, D. Dante Lorenso wrote:
Johannes Schlueter wrote:
please search the archives for "ifsetor".
I have completed this search and find:
http://marc.theaimsgr
direction? I need to be able to do all of the
following:
* variable number of parameters
* test 'isset' or 'empty'
* testing variables and non-variable values (pass-by-reference won't
work on values)
* not have side-effect of defining values which are not al
D. Dante Lorenso wrote:
I don't think something like this can NOT be written in userspace
because the 'isset' and 'empty' checks need to be run before arguments
can be passed to a user function or warnings will start flying. A
function like this simplifies code whi
All,
I'm sure this has been asked somewhere, but since I see requests for
features for 5.2 or 6.0, I'd like to add a "simple" item to the list
which would be quite useful to me and would simplify and clean up a lot
of code out there:
function coalesce(...)
This works much like in the SQL
ich could be used for CLI environment
stand-alone servers.
-- D. Dante Lorenso
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
41 matches
Mail list logo