3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $data = array('foo' => 'bar'); public function get($key) { return array_key_exists($key, $data) ? $data[$key] : NULL; } } $foo = new Foo(); $result = !empty($foo->get('foo')); var_export($result); $result = !empty($foo->get('bar')); var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c8ggq
function name:  (null)
number of ops:  22
compiled vars:  !0 = $foo, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        INIT_METHOD_CALL                                         !0, 'get'
          4        SEND_VAL_EX                                              'foo'
          5        DO_FCALL                                      0  $5      
          6        BOOL_NOT                                         ~6      $5
          7        BOOL_NOT                                         ~7      ~6
          8        ASSIGN                                                   !1, ~7
   15     9        INIT_FCALL                                               'var_export'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   16    12        INIT_METHOD_CALL                                         !0, 'get'
         13        SEND_VAL_EX                                              'bar'
         14        DO_FCALL                                      0  $10     
         15        BOOL_NOT                                         ~11     $10
         16        BOOL_NOT                                         ~12     ~11
         17        ASSIGN                                                   !1, ~12
   17    18        INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Foo:
Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c8ggq
function name:  get
number of ops:  9
compiled vars:  !0 = $key, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ARRAY_KEY_EXISTS                                         !0, !1
          2      > JMPZ                                                     ~2, ->6
          3    >   FETCH_DIM_R                                      ~3      !1, !0
          4        QM_ASSIGN                                        ~4      ~3
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~4      null
          7    > > RETURN                                                   ~4
    9     8*     > RETURN                                                   null

End of function get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.66 ms | 1396 KiB | 15 Q