3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = function ($p, $w) use (&$f) { return ($w) ? $p = $f($p + 0.25, $w - 1) : $p; }; foreach (explode(' ', '4 40 10 100 1') as $p) { echo $f($p, 5) . '<br>' . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/Z2L0o
function name:  (null)
number of ops:  19
compiled vars:  !0 = $f, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZ2L0o%3A3%240'
          1        BIND_LEXICAL                                             ~2, !0
          2        ASSIGN                                                   !0, ~2
    6     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '+'
          5        SEND_VAL                                                 '4+40+10+100+1'
          6        DO_ICALL                                         $4      
          7      > FE_RESET_R                                       $5      $4, ->17
          8    > > FE_FETCH_R                                               $5, !1, ->17
    7     9    >   INIT_DYNAMIC_CALL                                        !0
         10        SEND_VAR_EX                                              !1
         11        SEND_VAL_EX                                              5
         12        DO_FCALL                                      0  $6      
         13        CONCAT                                           ~7      $6, '%3Cbr%3E'
         14        CONCAT                                           ~8      ~7, '%0A'
         15        ECHO                                                     ~8
    6    16      > JMP                                                      ->8
         17    >   FE_FREE                                                  $5
    8    18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZ2L0o%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z2L0o
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $p, !1 = $w, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    4     3      > JMPZ                                                     !1, ->13
          4    >   INIT_DYNAMIC_CALL                                        !2
          5        ADD                                              ~3      !0, 0.25
          6        SEND_VAL_EX                                              ~3
          7        SUB                                              ~4      !1, 1
          8        SEND_VAL_EX                                              ~4
          9        DO_FCALL                                      0  $5      
         10        ASSIGN                                           ~6      !0, $5
         11        QM_ASSIGN                                        ~7      ~6
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~7      !0
         14    > > RETURN                                                   ~7
    5    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZ2L0o%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.53 ms | 1400 KiB | 15 Q