3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { return 'bar'; } public function baz() { return null; } } $foo = new Foo(); var_dump([ 'bar' => $foo->bar() ?: '', 'baz' => $foo->baz() ?: 'heh', //'quux' => $foo->quux() ?: 'wololo', ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkPtb
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_FCALL                                               'var_dump'
   16     4        INIT_METHOD_CALL                                         !0, 'bar'
          5        DO_FCALL                                      0  $4      
          6        JMP_SET                                          ~5      $4, ->8
          7        QM_ASSIGN                                        ~5      ''
          8        INIT_ARRAY                                       ~6      ~5, 'bar'
   17     9        INIT_METHOD_CALL                                         !0, 'baz'
         10        DO_FCALL                                      0  $7      
         11        JMP_SET                                          ~8      $7, ->13
         12        QM_ASSIGN                                        ~8      'heh'
         13        ADD_ARRAY_ELEMENT                                ~6      ~8, 'baz'
         14        SEND_VAL                                                 ~6
         15        DO_ICALL                                                 
   19    16      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkPtb
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'bar'
    6     1*     > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkPtb
function name:  baz
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null
   10     1*     > RETURN                                                   null

End of function baz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.83 ms | 1395 KiB | 15 Q