- var_dump: documentation ( source)
<?php
class Foo
{
protected static function bar($arg)
{
return $arg * 1;
}
protected static $map = [
'a' => 1,
'b' => 2,
'c' => 3,
'd' => 4,
'e' => 5
];
public static function test()
{
$foo = 'e';
if (isset(self::$map[$foo])) {
$b = self::bar(self::$map[$foo]);
}
var_dump($b);
}
}
Foo::test();