3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function foo (string $bar = null ): string { return 'test'; }; foo(); foo(null); foo('100');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHT50
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
   11     2        INIT_FCALL                                               'foo'
          3        SEND_VAL                                                 null
          4        DO_FCALL                                      0          
   12     5        INIT_FCALL                                               'foo'
          6        SEND_VAL                                                 '100'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHT50
function name:  foo
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      null
    7     1      > RETURN                                                   'test'
    8     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.39 ms | 1397 KiB | 16 Q