3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public ?string $foo; public string $foobar; public ?string $bar = ''; } $vars = get_object_vars(new A); var_dump(assert(array_key_exists('bar', $vars)) ? 'bar exists in $vars' : 'bar does not exist in $vars'); var_dump(assert(array_key_exists('foobar', $vars)) ? 'foobar exists in $vars' : 'foobar does not exist in $vars'); var_dump(assert(array_key_exists('foo', $vars)) ? 'foo exists in $vars' : 'foo does not exist in $vars');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
Branch analysis from position: 42
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
Branch analysis from position: 29
filename:       /in/eg6o0
function name:  (null)
number of ops:  46
compiled vars:  !0 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'get_object_vars'
          1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        SEND_VAR                                                 $1
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
   11     6        INIT_FCALL                                               'var_dump'
          7        ASSERT_CHECK                                     $6      
          8        INIT_FCALL                                               'assert'
          9        ARRAY_KEY_EXISTS                                 ~5      'bar', !0
         10        SEND_VAL                                                 ~5
         11        SEND_VAL                                                 'assert%28array_key_exists%28%27bar%27%2C+%24vars%29%29'
         12        DO_ICALL                                         $6      
         13      > JMPZ                                                     $6, ->16
         14    >   QM_ASSIGN                                        ~7      'bar+exists+in+%24vars'
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~7      'bar+does+not+exist+in+%24vars'
         17    >   SEND_VAL                                                 ~7
         18        DO_ICALL                                                 
   12    19        INIT_FCALL                                               'var_dump'
         20        ASSERT_CHECK                                     $10     
         21        INIT_FCALL                                               'assert'
         22        ARRAY_KEY_EXISTS                                 ~9      'foobar', !0
         23        SEND_VAL                                                 ~9
         24        SEND_VAL                                                 'assert%28array_key_exists%28%27foobar%27%2C+%24vars%29%29'
         25        DO_ICALL                                         $10     
         26      > JMPZ                                                     $10, ->29
         27    >   QM_ASSIGN                                        ~11     'foobar+exists+in+%24vars'
         28      > JMP                                                      ->30
         29    >   QM_ASSIGN                                        ~11     'foobar+does+not+exist+in+%24vars'
         30    >   SEND_VAL                                                 ~11
         31        DO_ICALL                                                 
   13    32        INIT_FCALL                                               'var_dump'
         33        ASSERT_CHECK                                     $14     
         34        INIT_FCALL                                               'assert'
         35        ARRAY_KEY_EXISTS                                 ~13     'foo', !0
         36        SEND_VAL                                                 ~13
         37        SEND_VAL                                                 'assert%28array_key_exists%28%27foo%27%2C+%24vars%29%29'
         38        DO_ICALL                                         $14     
         39      > JMPZ                                                     $14, ->42
         40    >   QM_ASSIGN                                        ~15     'foo+exists+in+%24vars'
         41      > JMP                                                      ->43
         42    >   QM_ASSIGN                                        ~15     'foo+does+not+exist+in+%24vars'
         43    >   SEND_VAL                                                 ~15
         44        DO_ICALL                                                 
         45      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.98 ms | 1405 KiB | 19 Q