3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new class { public function foo(){ return 'foo';}}; var_dump($a?->foo()); var_dump(($b = null)?->foo()); var_dump($c?->foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vMEvT
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $4      $3
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    5     4        INIT_FCALL                                               'var_dump'
          5        JMP_NULL                                         $7      !0
          6        INIT_METHOD_CALL                                         !0, 'foo'
          7        DO_FCALL                                      0  $7      
          8        SEND_VAR                                                 $7
          9        DO_ICALL                                                 
    7    10        INIT_FCALL                                               'var_dump'
         11        ASSIGN                                           ~9      !1, null
         12        JMP_NULL                                         $10     ~9
         13        INIT_METHOD_CALL                                         ~9, 'foo'
         14        DO_FCALL                                      0  $10     
         15        SEND_VAR                                                 $10
         16        DO_ICALL                                                 
    9    17        INIT_FCALL                                               'var_dump'
         18        JMP_NULL                                         $12     !2
         19        INIT_METHOD_CALL                                         !2, 'foo'
         20        DO_FCALL                                      0  $12     
         21        SEND_VAR                                                 $12
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

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

End of function foo

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.86 ms | 1395 KiB | 15 Q