3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayjson = [ ['string' => 'Something xxx something', 'value' => 10], ['string' => 'Something yyy something', 'value' => 20], ['string' => 'Something xxx something', 'value' => 30], ['string' => 'Something zzz something', 'value' => 40] ]; var_export( array_sum( array_column( array_filter( $arrayjson, function($row) { return strpos($row['string'], 'xxx') !== false; } ), 'value' ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IXiia
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arrayjson
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'var_export'
   11     2        INIT_FCALL                                               'array_sum'
   12     3        INIT_FCALL                                               'array_column'
   13     4        INIT_FCALL                                               'array_filter'
   14     5        SEND_VAR                                                 !0
   15     6        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   17     7        SEND_VAL                                                 ~2
   13     8        DO_ICALL                                         $3      
   17     9        SEND_VAR                                                 $3
   19    10        SEND_VAL                                                 'value'
   12    11        DO_ICALL                                         $4      
   19    12        SEND_VAR                                                 $4
   11    13        DO_ICALL                                         $5      
   19    14        SEND_VAR                                                 $5
   10    15        DO_ICALL                                                 
   22    16      > 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/IXiia
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'strpos'
          2        FETCH_DIM_R                                      ~1      !0, 'string'
          3        SEND_VAL                                                 ~1
          4        SEND_VAL                                                 'xxx'
          5        DO_ICALL                                         $2      
          6        TYPE_CHECK                                  1018  ~3      $2
          7      > RETURN                                                   ~3
   17     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.31 ms | 1079 KiB | 18 Q