semi_reserved_008.phpt [plain text]
--TEST--
Testing with comments around semi-reserved names (not intended to be legible)
--FILE--
<?php
trait TraitA
{
public static function list(){ echo __METHOD__, PHP_EOL; }
public static function catch(){ echo __METHOD__, PHP_EOL; }
private static function throw(){ echo __METHOD__, PHP_EOL; }
private static function
# comment
self(){ echo __METHOD__, PHP_EOL; }
}
trait TraitB
{
public static function exit(){ echo __METHOD__, PHP_EOL; }
protected static function try(){ echo __METHOD__, PHP_EOL; }
}
class Foo
{
use TraitA {
TraitA::
#
catch
# comment
insteadof TraitB;
TraitA::list as public foreach;
}
use TraitB {
try as public attempt;
exit asdie; \TraitB::exit as bye; namespace\TraitB::exit #
as byebye; TraitB
::
exit as farewell; }
}
Foo
#
::
#
attempt();
echo PHP_EOL, "Done", PHP_EOL;
--EXPECTF--
TraitB::try
Done