3v4l.org

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

Function dosomething:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Xv8g
function name:  doSomething
number of ops:  12
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->4
          3    > > RETURN                                                   null
    8     4    >   INIT_FCALL                                               'round'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 3
          7        DO_ICALL                                         $2      
          8        VERIFY_RETURN_TYPE                                       $2
          9      > RETURN                                                   $2
    9    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function dosomething

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.18 ms | 1007 KiB | 16 Q