3v4l.org

run code in 300+ PHP versions simultaneously
<?php class trial{ public $id; public static $sid; public static function show(){ if (trial::$sid) echo trial::$sid; else echo $this->id; } } $obj = new trial(); $obj->id = 1; $obj->show(); echo "\n\n"; trial::$sid = 5; echo trial::show();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VoCQY
function name:  (null)
number of ops:  14
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'trial'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        ASSIGN_OBJ                                               !0, 'id'
          4        OP_DATA                                                  1
   15     5        INIT_METHOD_CALL                                         !0, 'show'
          6        DO_FCALL                                      0          
   17     7        ECHO                                                     '%0A%0A'
   19     8        ASSIGN_STATIC_PROP                                       'sid', 'trial'
          9        OP_DATA                                                  5
   20    10        INIT_STATIC_METHOD_CALL                                  'trial', 'show'
         11        DO_FCALL                                      0  $7      
         12        ECHO                                                     $7
         13      > RETURN                                                   1

Class trial:
Function show:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VoCQY
function name:  show
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'sid'
          1      > JMPZ                                                     ~0, ->5
          2    >   FETCH_STATIC_PROP_R          unknown             ~1      'sid'
          3        ECHO                                                     ~1
          4      > JMP                                                      ->8
    9     5    >   FETCH_THIS                                       $2      
          6        FETCH_OBJ_R                                      ~3      $2, 'id'
          7        ECHO                                                     ~3
   10     8    > > RETURN                                                   null

End of function show

End of class trial.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.9 ms | 1394 KiB | 13 Q