3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $obj; const MAP = ['testKey' => 'test']; function __construct() { $this->obj = new \stdClass(); $this->obj->test = "testObject"; } public function isKey($name = 'testKey') { var_dump(empty($this->obj->{static::MAP[$name]})); var_dump(empty($this->obj->$name)); } } $t = new Test(); $t->isKey();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ue5Cj
function name:  (null)
number of ops:  6
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'isKey'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ue5Cj
function name:  __construct
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'obj'
          3        OP_DATA                                                  $1
   11     4        FETCH_OBJ_W                                      $3      'obj'
          5        ASSIGN_OBJ                                               $3, 'test'
          6        OP_DATA                                                  'testObject'
   12     7      > RETURN                                                   null

End of function __construct

Function iskey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ue5Cj
function name:  isKey
number of ops:  14
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV_INIT                                        !0      'testKey'
   15     1        INIT_FCALL                                               'var_dump'
          2        FETCH_CLASS_CONSTANT                             ~2      'MAP'
          3        FETCH_DIM_R                                      ~3      ~2, !0
          4        FETCH_OBJ_IS                                     ~1      'obj'
          5        ISSET_ISEMPTY_PROP_OBJ                           ~4      ~1, ~3
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   16     8        INIT_FCALL                                               'var_dump'
          9        FETCH_OBJ_IS                                     ~6      'obj'
         10        ISSET_ISEMPTY_PROP_OBJ                           ~7      ~6, !0
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
   17    13      > RETURN                                                   null

End of function iskey

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.6 ms | 1396 KiB | 15 Q