** Description changed:

- DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
- php --version
- PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch 
+ Description:
+ Passing object with __toString() causes segfault in random script iteration. 
When casted to string beforehand, it runs OK.
  
+ Test case:
  Code as
  <?php
  
  class A {
          public $a;
          public function __toString()
          {
                  $this->a = $this;
                  return 'waa?';
          }
  }
  
  $a = new A;
  echo trim($a);
  echo trim($a->a);
  
  ?>
  crashes in CLI, and run as php mod in apache
+ 
+ Enviroment:
+ DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
+ php --version
+ PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch

** Changed in: php5 (Ubuntu)
       Status: Triaged => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1198882

Title:
  __toString() which stores $this reference triggers segfault

To manage notifications about this bug go to:
https://bugs.launchpad.net/php/+bug/1198882/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to