3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_every(array $array, callable $fn) { return (boolean)array_product(array_map($fn, $array)); } var_dump( array_every([1, '2', true, []], function($value) { return $value; }) ); var_dump( array_every([1, '2', ''], function($value) { return $value; }) ); //
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1D1Ao
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
    8     1        INIT_FCALL                                               'array_every'
          2        SEND_VAL                                                 <array>
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1D1Ao%3A8%240'
          4        SEND_VAL                                                 ~0
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
   11     8        INIT_FCALL                                               'var_dump'
   12     9        INIT_FCALL                                               'array_every'
         10        SEND_VAL                                                 <array>
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1D1Ao%3A12%241'
         12        SEND_VAL                                                 ~3
         13        DO_FCALL                                      0  $4      
         14        SEND_VAR                                                 $4
         15        DO_ICALL                                                 
   15    16      > RETURN                                                   1

Function array_every:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1D1Ao
function name:  array_every
number of ops:  12
compiled vars:  !0 = $array, !1 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'array_product'
          3        INIT_FCALL                                               'array_map'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                         $3      
          9        BOOL                                             ~4      $3
         10      > RETURN                                                   ~4
    5    11*     > RETURN                                                   null

End of function array_every

Function %00%7Bclosure%7D%2Fin%2F1D1Ao%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1D1Ao
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1D1Ao%3A8%240

Function %00%7Bclosure%7D%2Fin%2F1D1Ao%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1D1Ao
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1D1Ao%3A12%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.01 ms | 1403 KiB | 21 Q