|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-07-01 05:47 UTC] Sky at quit-clan dot de
The following PHP code, executed as commandline script with php-4.3.0-dev-zend2-alpha2 gives a segmentation fault. php-4.2.1 doesnt have this problem.
#!/usr/sbin/php -f
<?php
class mytest {
function test()
{
echo "Hello\n";
}
function killmyself()
{
eval("\$this->test();");
}
}
$iwill = new mytest;
$iwill->killmyself();
echo "Sucessful.\n";
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Feb 13 13:00:01 2026 UTC |
It also happens with properties or any reference to $this inside an eval. If we do: $self=$this; eval('$self->test();'); It works fine. I'm using the Windows version of the same PHP release above.