3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("MAXSIZE", 100); //echo eval("MAXSIZE"); echo constant("MAXSIZE"); class T { public $a; public $b; } $obj = new T(); $cls = get_class($obj); $vars = get_class_vars($cls); //ๅ˜้‡ๅˆ—่กจ var_dump($vars); $str = '{"a":"pa","b":"pb"}'; $obj = json_decode($str,false); //$obj is stdclass $cls = get_class($obj); $vars = get_object_vars($obj); var_dump($vars); function ubb($matche) { if($matche[1]=='img' or $matche[1]=='IMG') return "<img src='".$matche[2]."'/>"; } $img = "img:[img]/sdfcs/sdfsdf/sdfsdf.jpg[/img],[url]http://www.oschina.net/[/url]"; $imghtml=preg_replace_callback("/\[(.*)\](.*)\[\/\1\]/U",ubb,$img); echo $imghtml;

preferences:
40.87 ms | 402 KiB | 5 Q