Re: [PHP-DEV] A new idea on PHP6.

2012-07-19 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Function proposal: varset

2011-04-20 Thread D. Dante Lorenso
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

[PHP-DEV] proposed access modifier "silent" ... was: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-10 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-09 Thread D. Dante Lorenso
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

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread D. Dante Lorenso
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

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Dante Lorenso
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

Re: [PHP-DEV] The constant use of isset()

2009-05-12 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Quick question about closing PHP tags

2009-02-02 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Making PHP upload hooks available through session variables?

2008-07-31 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Making PHP upload hooks available through session variables?

2008-07-30 Thread D. Dante Lorenso
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

Re: [PHP-DEV] New string functions: str_startswith() and str_endswith()

2008-07-21 Thread D. Dante Lorenso
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, -

Re: [PHP-DEV] Re: Traits for PHP ... Why can't every Class be a Trait?

2008-02-21 Thread D. Dante Lorenso
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

[PHP-DEV] Re: Traits for PHP ... Why can't every Class be a Trait?

2008-02-21 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Extending SAPI specific php.ini to include, at least, major version.

2006-06-12 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Re: extension can not receive unset values without E_NOTICE or referencecreation

2006-05-26 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Re: extension can not receive unset values without E_NOTICE or reference creation

2006-05-26 Thread D. Dante Lorenso
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

[PHP-DEV] extension can not receive unset values without E_NOTICE or reference creation

2006-05-26 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Re: left/right order of assignment and ++ increment changed? 5.0.x -->5.1.x

2006-05-24 Thread D. Dante Lorenso
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

[PHP-DEV] left/right order of assignment and ++ increment changed? 5.0.x --> 5.1.x

2006-05-24 Thread D. Dante Lorenso
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

[PHP-DEV] Is PostgreSQL 8.1.3--->8.1.4 necessary for 'properly' escaped coders?

2006-05-24 Thread D. Dante Lorenso
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

Re: [PHP-DEV] private, protected, readonly, public

2006-05-18 Thread D. Dante Lorenso
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

Re: [PHP-DEV] private, protected, readonly, public

2006-05-16 Thread D. Dante Lorenso
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

Re: [PHP-DEV] private, protected, readonly, public

2006-05-16 Thread D. Dante Lorenso
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.

Re: [PHP-DEV] xmlwriter_write_raw() not in 5.1.4 yet?

2006-05-15 Thread D. Dante Lorenso
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:/

[PHP-DEV] xmlwriter_write_raw() not in 5.1.4 yet?

2006-05-15 Thread D. Dante Lorenso
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_

Re: [PHP-DEV] private, protected, readonly, public

2006-05-12 Thread D. Dante Lorenso
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

Re: [PHP-DEV] allow extension writers to ignore E_NOTICE warnings about unset variables

2006-05-11 Thread D. Dante Lorenso
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

Re: [PHP-DEV] allow extension writers to ignore E_NOTICE warnings about unset variables

2006-05-11 Thread D. Dante Lorenso
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

[PHP-DEV] allow extension writers to ignore E_NOTICE warnings about unset variables

2006-05-11 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Specification for function filled() :: was ifsetor/coalesce

2006-05-04 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Seeking 'coalesce' php internal function

2006-05-04 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Seeking 'coalesce' php internal function

2006-05-03 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Seeking 'coalesce' php internal function

2006-05-03 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Seeking 'coalesce' php internal function

2006-05-03 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Seeking 'coalesce' php internal function

2006-05-03 Thread D. Dante Lorenso
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[

[PHP-DEV] Specification for function filled() :: was ifsetor/coalesce

2006-05-03 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Seeking 'coalesce' php internal function

2006-05-03 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Seeking 'coalesce' php internal function

2006-05-03 Thread D. Dante Lorenso
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

Re: [PHP-DEV] Seeking 'coalesce' php internal function

2006-05-02 Thread D. Dante Lorenso
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

[PHP-DEV] Seeking 'coalesce' php internal function

2006-05-02 Thread D. Dante Lorenso
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

[PHP-DEV] Request for Threads or SRM

2005-11-24 Thread D. Dante Lorenso
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