3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('array_all')) { function array_all(array $array, callable $callback): bool { foreach ($array as $key => $value) { if (!$callback($value, $key)) { return false; } } return true; } } $arr = [ [ 'date' => '2019-01-16', 'number1' => 20.4, 'number2' => 20.54, 'number3' => 19.71, 'number4' => 19.73, 'number5' => 70849266, 'number6' => 70849266, 'number7' => -0.65, 'number8' => -3.189, 'number9' => 20.0902, 'string1' => 'Jan16', 'number10' => 0.047796070100903 ], [ 'date' => '2019-01-16', 'number1' => 20.4, 'number2' => 20.54, 'number3' => 19.71, 'number4' => 19.73, 'number5' => 70849266, 'number6' => 70849266, 'number7' => -0.65, 'number8' => 'foo',#intentially not number 'number9' => 20.0902, 'string1' => 'Jan16', 'number10' => 0.047796070100903 ], ]; var_export( array_all($arr, fn($row) => is_numeric($row['number8'])) );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/GhMdRk
function name:  (null)
number of ops:  16
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'array_all'
          2        DO_ICALL                                         $1      
          3        BOOL_NOT                                         ~2      $1
          4      > JMPZ                                                     ~2, ->6
    4     5    >   DECLARE_FUNCTION                                         'array_all'
   15     6    >   ASSIGN                                                   !0, <array>
   46     7        INIT_FCALL                                               'var_export'
   47     8        INIT_FCALL_BY_NAME                                       'array_all'
          9        SEND_VAR_EX                                              !0
         10        DECLARE_LAMBDA_FUNCTION                          ~4      [1]
         11        SEND_VAL_EX                                              ~4
         12        DO_FCALL                                      0  $5      
         13        SEND_VAR                                                 $5
   46    14        DO_ICALL                                                 
   48    15      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/GhMdRk
function name:  array_all
number of ops:  18
compiled vars:  !0 = $array, !1 = $callback, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2      > FE_RESET_R                                       $4      !0, ->14
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->14
          4    >   ASSIGN                                                   !3, ~5
    6     5        INIT_DYNAMIC_CALL                                        !1
          6        SEND_VAR_EX                                              !2
          7        SEND_VAR_EX                                              !3
          8        DO_FCALL                                      0  $7      
          9        BOOL_NOT                                         ~8      $7
         10      > JMPZ                                                     ~8, ->13
    7    11    >   FE_FREE                                                  $4
         12      > RETURN                                                   <false>
    5    13    > > JMP                                                      ->3
         14    >   FE_FREE                                                  $4
   11    15      > RETURN                                                   <true>
   12    16*       VERIFY_RETURN_TYPE                                       
         17*     > 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/GhMdRk
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'is_numeric'
          2        FETCH_DIM_R                                      ~1      !0, 'number8'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
          6*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.78 ms | 1007 KiB | 16 Q