3v4l.org

run code in 300+ PHP versions simultaneously
<?php $object1 = new stdClass(); $object1->id = 1; $object1->nome = 'B'; $object2 = new stdClass(); $object2->id = 1; $object2->nome = 'A'; $dados = array($object1, $object2); function orderData(array $data) { $alphabetic = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'z'); $asc = array(); foreach ($alphabetic as $keyAlpha => $valueAlpha) { foreach ($data as $key => $value) { $letter = $value->nome; $letter = $letter['0']; if ($valueAlpha == $letter || strtoupper($letter) == strtoupper($letter)) { $asc[$key] = $value; } } } return $asc; } var_dump( orderData($dados) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lJplU
function name:  (null)
number of ops:  24
compiled vars:  !0 = $object1, !1 = $object2, !2 = $dados
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        ASSIGN_OBJ                                               !0, 'id'
          4        OP_DATA                                                  1
    5     5        ASSIGN_OBJ                                               !0, 'nome'
          6        OP_DATA                                                  'B'
    7     7        NEW                                              $8      'stdClass'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $8
    8    10        ASSIGN_OBJ                                               !1, 'id'
         11        OP_DATA                                                  1
    9    12        ASSIGN_OBJ                                               !1, 'nome'
         13        OP_DATA                                                  'A'
   11    14        INIT_ARRAY                                       ~13     !0
         15        ADD_ARRAY_ELEMENT                                ~13     !1
         16        ASSIGN                                                   !2, ~13
   31    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'orderdata'
         19        SEND_VAR                                                 !2
         20        DO_FCALL                                      0  $15     
         21        SEND_VAR                                                 $15
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function orderdata:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 29
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 29
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 27
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 23
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 26
Branch analysis from position: 23
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 27
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/lJplU
function name:  orderData
number of ops:  32
compiled vars:  !0 = $data, !1 = $alphabetic, !2 = $asc, !3 = $valueAlpha, !4 = $keyAlpha, !5 = $value, !6 = $key, !7 = $letter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ASSIGN                                                   !1, <array>
   15     2        ASSIGN                                                   !2, <array>
   17     3      > FE_RESET_R                                       $10     !1, ->29
          4    > > FE_FETCH_R                                       ~11     $10, !3, ->29
          5    >   ASSIGN                                                   !4, ~11
   18     6      > FE_RESET_R                                       $13     !0, ->27
          7    > > FE_FETCH_R                                       ~14     $13, !5, ->27
          8    >   ASSIGN                                                   !6, ~14
   19     9        FETCH_OBJ_R                                      ~16     !5, 'nome'
         10        ASSIGN                                                   !7, ~16
   20    11        FETCH_DIM_R                                      ~18     !7, 0
         12        ASSIGN                                                   !7, ~18
   22    13        IS_EQUAL                                         ~20     !3, !7
         14      > JMPNZ_EX                                         ~20     ~20, ->23
         15    >   INIT_FCALL                                               'strtoupper'
         16        SEND_VAR                                                 !7
         17        DO_ICALL                                         $21     
         18        INIT_FCALL                                               'strtoupper'
         19        SEND_VAR                                                 !7
         20        DO_ICALL                                         $22     
         21        IS_EQUAL                                         ~23     $21, $22
         22        BOOL                                             ~20     ~23
         23    > > JMPZ                                                     ~20, ->26
   23    24    >   ASSIGN_DIM                                               !2, !6
         25        OP_DATA                                                  !5
   18    26    > > JMP                                                      ->7
         27    >   FE_FREE                                                  $13
   17    28      > JMP                                                      ->4
         29    >   FE_FREE                                                  $10
   28    30      > RETURN                                                   !2
   29    31*     > RETURN                                                   null

End of function orderdata

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.49 ms | 1402 KiB | 18 Q