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;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lV5qM
function name:  (null)
number of ops:  45
compiled vars:  !0 = $obj, !1 = $cls, !2 = $vars, !3 = $str, !4 = $img, !5 = $imghtml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'MAXSIZE'
          2        SEND_VAL                                                 100
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'constant'
          5        SEND_VAL                                                 'MAXSIZE'
          6        DO_ICALL                                         $7      
          7        ECHO                                                     $7
   15     8        NEW                                              $8      'T'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !0, $8
   17    11        GET_CLASS                                        ~11     !0
         12        ASSIGN                                                   !1, ~11
   19    13        INIT_FCALL                                               'get_class_vars'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !2, $13
   20    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   21    20        ASSIGN                                                   !3, '%7B%22a%22%3A%22pa%22%2C%22b%22%3A%22pb%22%7D'
   23    21        INIT_FCALL                                               'json_decode'
         22        SEND_VAR                                                 !3
         23        SEND_VAL                                                 <false>
         24        DO_ICALL                                         $17     
         25        ASSIGN                                                   !0, $17
   24    26        GET_CLASS                                        ~19     !0
         27        ASSIGN                                                   !1, ~19
   26    28        INIT_FCALL                                               'get_object_vars'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $21     
         31        ASSIGN                                                   !2, $21
   27    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                                 
   34    35        ASSIGN                                                   !4, 'img%3A%5Bimg%5D%2Fsdfcs%2Fsdfsdf%2Fsdfsdf.jpg%5B%2Fimg%5D%2C%5Burl%5Dhttp%3A%2F%2Fwww.oschina.net%2F%5B%2Furl%5D'
   36    36        INIT_FCALL                                               'preg_replace_callback'
         37        SEND_VAL                                                 '%2F%5C%5B%28.%2A%29%5C%5D%28.%2A%29%5C%5B%5C%2F%5C1%5C%5D%2FU'
         38        FETCH_CONSTANT                                   ~25     'ubb'
         39        SEND_VAL                                                 ~25
         40        SEND_VAR                                                 !4
         41        DO_ICALL                                         $26     
         42        ASSIGN                                                   !5, $26
   37    43        ECHO                                                     !5
         44      > RETURN                                                   1

Function ubb:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/lV5qM
function name:  ubb
number of ops:  13
compiled vars:  !0 = $matche
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
   30     1        FETCH_DIM_R                                      ~1      !0, 1
          2        IS_EQUAL                                         ~2      ~1, 'img'
          3      > JMPNZ_EX                                         ~2      ~2, ->7
          4    >   FETCH_DIM_R                                      ~3      !0, 1
          5        IS_EQUAL                                         ~4      ~3, 'IMG'
          6        BOOL                                             ~2      ~4
          7    > > JMPZ                                                     ~2, ->12
   31     8    >   FETCH_DIM_R                                      ~5      !0, 2
          9        CONCAT                                           ~6      '%3Cimg+src%3D%27', ~5
         10        CONCAT                                           ~7      ~6, '%27%2F%3E'
         11      > RETURN                                                   ~7
   32    12    > > RETURN                                                   null

End of function ubb

Class T: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.01 ms | 1400 KiB | 27 Q