3v4l.org

run code in 500+ 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:/in/IXiia:15}
number of ops:  6
compiled vars:  !0 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
   16     1        FETCH_DIM_R                                          ~1      !0, 'string'
          2        FRAMELESS_ICALL_2                strpos              ~2      ~1, 'xxx'
          3        TYPE_CHECK                                      1018  ~3      ~2
          4      > RETURN                                                       ~3
   17     5*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.67 ms | 2124 KiB | 17 Q