3v4l.org

run code in 300+ PHP versions simultaneously
<?php $gatos = array( array( "id" => 1, "name" => "Titus", "fecha" => new \DateTime(), ), array( "id" => 2, "name" => "Gato", "fecha" => new \DateTime(), ), ); usort($gatos, function($gato1,$gato2){ return strcmp($gato1["fecha"]->format("md"),$gato2["fecha"]->format("md")); }); var_dump($gatos);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hAKIp
function name:  (null)
number of ops:  22
compiled vars:  !0 = $gatos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_ARRAY                                       ~1      1, 'id'
    6     1        ADD_ARRAY_ELEMENT                                ~1      'Titus', 'name'
    7     2        NEW                                              $2      'DateTime'
          3        DO_FCALL                                      0          
          4        ADD_ARRAY_ELEMENT                                ~1      $2, 'fecha'
          5        INIT_ARRAY                                       ~4      ~1
   10     6        INIT_ARRAY                                       ~5      2, 'id'
   11     7        ADD_ARRAY_ELEMENT                                ~5      'Gato', 'name'
   12     8        NEW                                              $6      'DateTime'
          9        DO_FCALL                                      0          
         10        ADD_ARRAY_ELEMENT                                ~5      $6, 'fecha'
         11        ADD_ARRAY_ELEMENT                                ~4      ~5
    3    12        ASSIGN                                                   !0, ~4
   16    13        INIT_FCALL                                               'usort'
         14        SEND_REF                                                 !0
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhAKIp%3A16%240'
   18    16        SEND_VAL                                                 ~9
         17        DO_ICALL                                                 
   20    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhAKIp%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hAKIp
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $gato1, !1 = $gato2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        INIT_FCALL                                               'strcmp'
          3        FETCH_DIM_R                                      ~2      !0, 'fecha'
          4        INIT_METHOD_CALL                                         ~2, 'format'
          5        SEND_VAL_EX                                              'md'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR                                                 $3
          8        FETCH_DIM_R                                      ~4      !1, 'fecha'
          9        INIT_METHOD_CALL                                         ~4, 'format'
         10        SEND_VAL_EX                                              'md'
         11        DO_FCALL                                      0  $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                         $6      
         14      > RETURN                                                   $6
   18    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhAKIp%3A16%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.32 ms | 1401 KiB | 19 Q