|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-06-17 14:42 UTC] 007not at gmail dot com
Description:
------------
Take a good look in the code, a special attention to : at line 10. I think that PHP should produce an error in this line.
Test script:
---------------
<?php
class test
{
static $var = 0;
static function run()
{
$var = 1;
$newvar = 2;
self:$var = $newvar; //where is error?! this is line 10
echo $var . PHP_EOL;
echo self::$var . PHP_EOL;
//echo self:$var; //rise error!
}
}
test::run();
Expected result:
----------------
an error in line 10
Actual result:
--------------
2
0
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 01:00:01 2025 UTC |
`self:` creates a goto label with name "self". You could write that line as self: $var = $newvar; So the code is perfectly valid.