3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $processor = compose( htmlentities(...), str_split(...), fn ($x) => array_map(strtoupper(...), $x), fn ($x) => array_filter($x, fn ($v) => $v != 'O'), ); $data = "Hello World!"; var_dump( $data, $processor($data), ); // polyfill function compose(...$calls): Closure { $next = fn ($data) => $data; foreach ($calls as $prev) { $next = fn ($data) => $prev($next($data)); } return $next; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4EE6b
function name:  (null)
number of ops:  23
compiled vars:  !0 = $processor, !1 = $v, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL_BY_NAME                                       'compose'
    6     1        INIT_FCALL                                               'htmlentities'
          2        ZEND_CALLABLE_CONVERT                            ~3      
          3        SEND_VAL_EX                                              ~3
    7     4        INIT_FCALL                                               'str_split'
          5        ZEND_CALLABLE_CONVERT                            ~4      
          6        SEND_VAL_EX                                              ~4
    8     7        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          8        SEND_VAL_EX                                              ~5
    9     9        DECLARE_LAMBDA_FUNCTION                          ~6      [1]
         10        BIND_LEXICAL                                             ~6, !1
         11        SEND_VAL_EX                                              ~6
    5    12        DO_FCALL                                      0  $7      
         13        ASSIGN                                                   !0, $7
   13    14        ASSIGN                                                   !2, 'Hello+World%21'
   15    15        INIT_FCALL                                               'var_dump'
   16    16        SEND_VAR                                                 !2
   17    17        INIT_DYNAMIC_CALL                                        !0
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0  $10     
         20        SEND_VAR                                                 $10
   15    21        DO_ICALL                                                 
   32    22      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4EE6b
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'array_map'
          2        INIT_FCALL                                               'strtoupper'
          3        ZEND_CALLABLE_CONVERT                            ~1      
          4        SEND_VAL                                                 ~1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
          8*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4EE6b
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $x, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
          8*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4EE6b
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        IS_NOT_EQUAL                                     ~1      !0, 'O'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of Dynamic Function 0

End of Dynamic Function 1

Function compose:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/4EE6b
function name:  compose
number of ops:  15
compiled vars:  !0 = $calls, !1 = $next, !2 = $prev
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV_VARIADIC                                    !0      
   26     1        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          2        ASSIGN                                                   !1, ~3
   27     3      > FE_RESET_R                                       $5      !0, ->10
          4    > > FE_FETCH_R                                               $5, !2, ->10
   28     5    >   DECLARE_LAMBDA_FUNCTION                          ~6      [1]
          6        BIND_LEXICAL                                             ~6, !2
          7        BIND_LEXICAL                                             ~6, !1
          8        ASSIGN                                                   !1, ~6
   27     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $5
   31    11        VERIFY_RETURN_TYPE                                       !1
         12      > RETURN                                                   !1
   32    13*       VERIFY_RETURN_TYPE                                       
         14*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4EE6b
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4EE6b
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $data, !1 = $prev, !2 = $next
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
          3        INIT_DYNAMIC_CALL                                        !1
          4        INIT_DYNAMIC_CALL                                        !2
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR_NO_REF_EX                                       $3
          8        DO_FCALL                                      0  $4      
          9      > RETURN                                                   $4
         10*     > RETURN                                                   null

End of Dynamic Function 1

End of function compose

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.06 ms | 1012 KiB | 19 Q