3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public static $myVariable; public static function set($name, $value) { if (true === property_exists('MyClass', $name)) { self::$name = $value; } } } MyClass::set('myVariable', 123); echo MyClass::myVariable;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iZjRN
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_STATIC_METHOD_CALL                                  'MyClass', 'set'
          1        SEND_VAL                                                 'myVariable'
          2        SEND_VAL                                                 123
          3        DO_FCALL                                      0          
   13     4        FETCH_CLASS_CONSTANT                             ~1      'MyClass', 'myVariable'
          5        ECHO                                                     ~1
          6      > RETURN                                                   1

Class MyClass:
Function set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/iZjRN
function name:  set
number of ops:  11
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'property_exists'
          3        SEND_VAL                                                 'MyClass'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        TYPE_CHECK                                    8          $2
          7      > JMPZ                                                     ~3, ->10
    8     8    >   ASSIGN_STATIC_PROP                                       'name'
          9        OP_DATA                                                  !1
   10    10    > > RETURN                                                   null

End of function set

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.87 ms | 1395 KiB | 15 Q