3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add(int $a, int $b): int { return $a + $b; } echo add($a = add($a = 2, $a), $a = add($a, $a)) + $a . "\n"; var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MPb5P
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'add'
          1        INIT_FCALL                                               'add'
          2        ASSIGN                                           ~1      !0, 2
          3        SEND_VAL                                                 ~1
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6        ASSIGN                                           ~3      !0, $2
          7        SEND_VAL                                                 ~3
          8        INIT_FCALL                                               'add'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0  $4      
         12        ASSIGN                                           ~5      !0, $4
         13        SEND_VAL                                                 ~5
         14        DO_FCALL                                      0  $6      
         15        ADD                                              ~7      $6, !0
         16        CONCAT                                           ~8      ~7, '%0A'
         17        ECHO                                                     ~8
    9    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MPb5P
function name:  add
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ADD                                              ~2      !0, !1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
    5     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function add

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.54 ms | 1008 KiB | 17 Q