#32869 [NEW]: Session and reference related

2005-04-28 Thread thomas dot ene at gmail dot com
From: thomas dot ene at gmail dot com
Operating system: Windows
PHP version:  4.3.9
PHP Bug Type: Session related
Bug description:  Session and reference related

Description:

Let's say I have a class c1. Doing this:

$obj = &$_SESSION['obj'];
$obj = &new c1();

would set $_SESSION['obj'] to NULL.

Reproduce code:
---
v = $a; }
function say()  { print "{$this->v}"; }
}

session_start();
session_destroy();

$obj = &$_SESSION['aaa'];
$obj = &new c1(6);

var_dump($_SESSION['aaa']);
?>

Expected result:

I would expect to have an object in the $_SESSION['aaa']

Actual result:
--
The actual result is NULL. Sorry if this is post in not pertinent but I
haven't found any support related to this.

-- 
Edit bug report at http://bugs.php.net/?id=32869&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32869&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32869&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32869&r=trysnapshot51
Fixed in CVS:http://bugs.php.net/fix.php?id=32869&r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=32869&r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=32869&r=needtrace
Need Reproduce Script:   http://bugs.php.net/fix.php?id=32869&r=needscript
Try newer version:   http://bugs.php.net/fix.php?id=32869&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32869&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=32869&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=32869&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=32869&r=submittedtwice
register_globals:http://bugs.php.net/fix.php?id=32869&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32869&r=php3
Daylight Savings:http://bugs.php.net/fix.php?id=32869&r=dst
IIS Stability:   http://bugs.php.net/fix.php?id=32869&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32869&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32869&r=float
No Zend Extensions:  http://bugs.php.net/fix.php?id=32869&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32869&r=mysqlcfg


[PHP-BUG] Req #65303 [NEW]: Make traits more flexibile

2013-07-20 Thread thomas dot ene at gmail dot com
From: thomas dot ene at gmail dot com
Operating system: -
PHP version:  5.4.17
Package:  *General Issues
Bug Type: Feature/Change Request
Bug description:Make traits more flexibile

Description:

I find traits very useful (i've been waiting for their availability for a
long time) - however I think people could benefit from having a bit more
flexibility when using them - specifically when dealing with trait method
renaming - rather then being forced to choose one method over the other, I
think it would be useful to have the option to rename all methods from all
traits to our liking. I've posted an example in the test/script section.



Test script:
---
trait dog {
public function bark() {
echo("Bark, bark, bark!");
$this->breathe();
}
public function breathe() {
echo("...dog breathing...");
}
}

trait snake {
public function hiss() {
echo("ss!");
$this->breathe();
}
public function breathe() {
echo("...snake breathing...");
}
}

class pugosnake {
use dog, snake {
//What I think it would be useful is this
dog::breathe as dogBreathe;
dog::bark as dogBark; // which will call the correct breathe 
function
(dogBreathe now);
snake::breathe as snakeBreathe;
snake::hiss as snakeHiss; // which will also call the correct 
breathe
function (snakeBreathe now);
}
}

$a = new pugosnake();
$a->dogBreathe(); // Produces "Bark, bark, bark...dog breathing..."
$a->snakeBreathe(); // Produces "ss...snake breathing..."

// Right now this doesn't work as we're forced to select one breathe method
over the other



-- 
Edit bug report at https://bugs.php.net/bug.php?id=65303&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65303&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65303&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=65303&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=65303&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=65303&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65303&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=65303&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=65303&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=65303&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=65303&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=65303&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=65303&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=65303&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65303&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=65303&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=65303&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=65303&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65303&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65303&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65303&r=mysqlcfg



Req #65303 [Nab]: Make traits more flexibile

2013-07-23 Thread thomas dot ene at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65303&edit=1

 ID: 65303
 User updated by:thomas dot ene at gmail dot com
 Reported by:thomas dot ene at gmail dot com
 Summary:Make traits more flexibile
 Status: Not a bug
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   -
 PHP Version:5.4.17
 Block user comment: N
 Private report: N

 New Comment:

Many thanks Stefan, with your last comment it makes sense. Apologies for 
submitting this as a bug though, I was actually looking for a "feature request" 
section - and the closest I could find was: "Bug"/"Feature/change request".

Best Regards,
Thomas


Previous Comments:

[2013-07-22 08:50:26] g...@php.net

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Hi Thomas:

If I understand you correctly, it already works what you are asking for.

So, this should work:

dog::breathe as dogBreathe;
dog::bark as dogBark;
snake::breathe as snakeBreathe;
snake::hiss as snakeHiss;

See the last part of Example #5: 
http://php.net/manual/en/language.oop5.traits.php 
However, since `as` introduces an alias and does not do renaming, you still 
need 
to resolve the conflicts explicitly with 
`insteadof`.

This is on purpose. While you might argue that it is not 'DRY', it makes you 
formulate explicitly what you need, and therefore 
provides some protection from unexpected changes in the traits hierarchy.

Hope this helps
Stefan

--------------------
[2013-07-21 00:12:39] thomas dot ene at gmail dot com

Description:

I find traits very useful (i've been waiting for their availability for a long 
time) - however I think people could benefit from having a bit more flexibility 
when using them - specifically when dealing with trait method renaming - rather 
then being forced to choose one method over the other, I think it would be 
useful to have the option to rename all methods from all traits to our liking. 
I've posted an example in the test/script section.



Test script:
---
trait dog {
public function bark() {
echo("Bark, bark, bark!");
$this->breathe();
}
public function breathe() {
echo("...dog breathing...");
}
}

trait snake {
public function hiss() {
echo("ss!");
$this->breathe();
}
public function breathe() {
echo("...snake breathing...");
}
}

class pugosnake {
use dog, snake {
//What I think it would be useful is this
dog::breathe as dogBreathe;
dog::bark as dogBark; // which will call the correct breathe 
function (dogBreathe now);
snake::breathe as snakeBreathe;
snake::hiss as snakeHiss; // which will also call the correct 
breathe function (snakeBreathe now);
}
}

$a = new pugosnake();
$a->dogBreathe(); // Produces "Bark, bark, bark...dog breathing..."
$a->snakeBreathe(); // Produces "ss...snake breathing..."

// Right now this doesn't work as we're forced to select one breathe method 
over the other








-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65303&edit=1


#36978 [NEW]: PHP Crashes and issues a windows message box

2006-04-04 Thread thomas dot ene at gmail dot com
From: thomas dot ene at gmail dot com
Operating system: Windows
PHP version:  5.1.2
PHP Bug Type: Reproducible crash
Bug description:  PHP Crashes and issues a windows message box

Description:

The code below produces:
Fatal error: Couldn't execute method demo::__set in Unknown on line 0
and also a windows message box.

Reproduce code:
---
a++;
}
}

$obj = new demo();
$obj->play();

?>

Expected result:

It should set the property a to 1 in the demo class

Actual result:
--
The code below produces:
Fatal error: Couldn't execute method demo::__set in Unknown on line 0
and also a windows message box.

-- 
Edit bug report at http://bugs.php.net/?id=36978&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36978&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36978&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36978&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36978&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=36978&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=36978&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=36978&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=36978&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=36978&r=support
Expected behavior:http://bugs.php.net/fix.php?id=36978&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=36978&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=36978&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36978&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36978&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36978&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=36978&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=36978&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36978&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=36978&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=36978&r=mysqlcfg


#36978 [Bgs]: PHP Crashes and issues a windows message box

2006-04-05 Thread thomas dot ene at gmail dot com
 ID:   36978
 User updated by:  thomas dot ene at gmail dot com
 Reported By:  thomas dot ene at gmail dot com
 Status:   Bogus
 Bug Type: Reproducible crash
 Operating System: Windows
 PHP Version:  5.1.2
 New Comment:

Yes but showing a windows popup isn't normal behaviour either.
Anyway, thanks for the information. The issue about increment/decrement
operators wasn't commented out in the standard documentation.

Thank you and have a splendid day.


Previous Comments:


[2006-04-05 06:30:42] [EMAIL PROTECTED]

A "Fatal Error" ain't a crash.
You can't use in/decrement operators on overloaded properties.


----

[2006-04-04 23:06:09] thomas dot ene at gmail dot com

Description:

The code below produces:
Fatal error: Couldn't execute method demo::__set in Unknown on line 0
and also a windows message box.

Reproduce code:
---
a++;
}
}

$obj = new demo();
$obj->play();

?>

Expected result:

It should set the property a to 1 in the demo class

Actual result:
--
The code below produces:
Fatal error: Couldn't execute method demo::__set in Unknown on line 0
and also a windows message box.





-- 
Edit this bug report at http://bugs.php.net/?id=36978&edit=1