3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class trial{ public $id; public static $sid; public 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();
based on LXdls
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/SS9K5
function name:  (null)
number of ops:  15
compiled vars:  !0 = $obj
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  13     1        NEW                                              $2      :-6
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $2
  14     4        ASSIGN_OBJ                                               !0, 'id'
         5        OP_DATA                                                  1
  15     6        INIT_METHOD_CALL                                         !0, 'show'
         7        DO_FCALL                                      0          
  17     8        ECHO                                                     '%0A%0A'
  19     9        FETCH_W                      static member       $7      'sid'
        10        ASSIGN                                                   $7, 5
  20    11        INIT_STATIC_METHOD_CALL                                  'trial', 'show'
        12        DO_FCALL                                      0  $9      
        13        ECHO                                                     $9
        14      > RETURN                                                   1

Class trial:
Function show:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
Jump found. Position 1 = 7
Branch analysis from position: 7
Jump found. Position 1 = -2
Branch analysis from position: 5
Jump found. Position 1 = -2
filename:       /in/SS9K5
function name:  show
number of ops:  8
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   8     0  E >   FETCH_R                      static member       $0      'sid'
         1      > JMPZ                                                     $0, ->5
         2    >   FETCH_R                      static member       $1      'sid'
         3        ECHO                                                     $1
         4      > JMP                                                      ->7
   9     5    >   FETCH_OBJ_R                                      $2      'id'
         6        ECHO                                                     $2
  10     7    > > RETURN                                                   null

End of function show

End of class trial.

Generated using Vulcan Logic Dumper, using php 7.3.0