3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new \StdClass; $obj->textfield->id = 'text12'; $obj->textfield->text = 'herro'; $anotherObj = new \StdClass; $anotherObj->textfield->id = 'text1'; $anotherObj->textfield->text = 'moarrr text'; $yesAnother = new \StdClass; $yesAnother->textfield->id = 'text11'; $yesAnother->textfield->text = 'omggggg'; $array = array($obj, $anotherObj, $yesAnother); usort($array, function($a, $b) { preg_match_all('#\d+#', $a->textfield->id, $matchesA); preg_match_all('#\d+#', $b->textfield->id, $matchesB); $idNumA = (int)$matchesA[0][0]; $idNumB = (int)$matchesB[0][0]; return $idNumA > $idNumB; }); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l2lcf
function name:  (null)
number of ops:  40
compiled vars:  !0 = $obj, !1 = $anotherObj, !2 = $yesAnother, !3 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    4     3        FETCH_OBJ_W                                      $7      !0, 'textfield'
          4        ASSIGN_OBJ                                               $7, 'id'
          5        OP_DATA                                                  'text12'
    5     6        FETCH_OBJ_W                                      $9      !0, 'textfield'
          7        ASSIGN_OBJ                                               $9, 'text'
          8        OP_DATA                                                  'herro'
    7     9        NEW                                              $11     'StdClass'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $11
    8    12        FETCH_OBJ_W                                      $14     !1, 'textfield'
         13        ASSIGN_OBJ                                               $14, 'id'
         14        OP_DATA                                                  'text1'
    9    15        FETCH_OBJ_W                                      $16     !1, 'textfield'
         16        ASSIGN_OBJ                                               $16, 'text'
         17        OP_DATA                                                  'moarrr+text'
   11    18        NEW                                              $18     'StdClass'
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !2, $18
   12    21        FETCH_OBJ_W                                      $21     !2, 'textfield'
         22        ASSIGN_OBJ                                               $21, 'id'
         23        OP_DATA                                                  'text11'
   13    24        FETCH_OBJ_W                                      $23     !2, 'textfield'
         25        ASSIGN_OBJ                                               $23, 'text'
         26        OP_DATA                                                  'omggggg'
   15    27        INIT_ARRAY                                       ~25     !0
         28        ADD_ARRAY_ELEMENT                                ~25     !1
         29        ADD_ARRAY_ELEMENT                                ~25     !2
         30        ASSIGN                                                   !3, ~25
   17    31        INIT_FCALL                                               'usort'
         32        SEND_REF                                                 !3
         33        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fl2lcf%3A17%240'
   24    34        SEND_VAL                                                 ~27
         35        DO_ICALL                                                 
   26    36        INIT_FCALL                                               'var_dump'
         37        SEND_VAR                                                 !3
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fl2lcf%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l2lcf
function name:  {closure}
number of ops:  27
compiled vars:  !0 = $a, !1 = $b, !2 = $matchesA, !3 = $matchesB, !4 = $idNumA, !5 = $idNumB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%23%5Cd%2B%23'
          4        FETCH_OBJ_R                                      ~6      !0, 'textfield'
          5        FETCH_OBJ_R                                      ~7      ~6, 'id'
          6        SEND_VAL                                                 ~7
          7        SEND_REF                                                 !2
          8        DO_ICALL                                                 
   20     9        INIT_FCALL                                               'preg_match_all'
         10        SEND_VAL                                                 '%23%5Cd%2B%23'
         11        FETCH_OBJ_R                                      ~9      !1, 'textfield'
         12        FETCH_OBJ_R                                      ~10     ~9, 'id'
         13        SEND_VAL                                                 ~10
         14        SEND_REF                                                 !3
         15        DO_ICALL                                                 
   21    16        FETCH_DIM_R                                      ~12     !2, 0
         17        FETCH_DIM_R                                      ~13     ~12, 0
         18        CAST                                          4  ~14     ~13
         19        ASSIGN                                                   !4, ~14
   22    20        FETCH_DIM_R                                      ~16     !3, 0
         21        FETCH_DIM_R                                      ~17     ~16, 0
         22        CAST                                          4  ~18     ~17
         23        ASSIGN                                                   !5, ~18
   23    24        IS_SMALLER                                       ~20     !5, !4
         25      > RETURN                                                   ~20
   24    26*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fl2lcf%3A17%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.82 ms | 1400 KiB | 19 Q