3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( array("id" => 1, "name" => "njx", "count" => 0), array("id" => 2, "name" => "peter", "count" => 4), array("id" => 3, "name" => "jeffry", "count" => 2), array("id" => 4, "name" => "adam", "count" => 6) ); $fa = array_filter($a, function ($item) { return ($item["count"] > 0); }); function comp() { // whatever return 1; } usort($fa, 'comp'); foreach ($fa as &$t) { $t["score"] = 120; } var_dump($a); //this doesn't contain "score" field.
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
2 jumps found. (Code = 126) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/bOe16
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $fa, !2 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FbOe16%3A10%240'
   12     4        SEND_VAL                                                 ~4
          5        DO_ICALL                                         $5      
   10     6        ASSIGN                                                   !1, $5
   19     7        INIT_FCALL                                               'usort'
          8        SEND_REF                                                 !1
          9        SEND_VAL                                                 'comp'
         10        DO_ICALL                                                 
   21    11      > FE_RESET_RW                                      $8      !1, ->16
         12    > > FE_FETCH_RW                                              $8, !2, ->16
   22    13    >   ASSIGN_DIM                                               !2, 'score'
         14        OP_DATA                                                  120
   21    15      > JMP                                                      ->12
         16    >   FE_FREE                                                  $8
   25    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FbOe16%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bOe16
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        FETCH_DIM_R                                      ~1      !0, 'count'
          2        IS_SMALLER                                       ~2      0, ~1
          3      > RETURN                                                   ~2
   12     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FbOe16%3A10%240

Function comp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bOe16
function name:  comp
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   1
   17     1*     > RETURN                                                   null

End of function comp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.81 ms | 1396 KiB | 19 Q