3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ "2021-01-01", "2019-05-23", "2022-09-13", ]; $dates = array_map( function (string $dateString) { return new \DateTimeImmutable($dateString); }, $input ); sort($dates); $output = array_map( function (\DateTimeImmutable $date) { return $date->format("Y-m-d"); }, $dates ); var_dump($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1KeZM
function name:  (null)
number of ops:  20
compiled vars:  !0 = $input, !1 = $dates, !2 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'array_map'
   10     2        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
   12     3        SEND_VAL                                                 ~4
   13     4        SEND_VAR                                                 !0
    9     5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
   16     7        INIT_FCALL                                               'sort'
          8        SEND_REF                                                 !1
          9        DO_ICALL                                                 
   18    10        INIT_FCALL                                               'array_map'
   19    11        DECLARE_LAMBDA_FUNCTION                          ~8      [1]
   21    12        SEND_VAL                                                 ~8
   22    13        SEND_VAR                                                 !1
   18    14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !2, $9
   25    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > 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/1KeZM
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $dateString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        NEW                                              $1      'DateTimeImmutable'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $1
   12     5*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1KeZM
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        INIT_METHOD_CALL                                         !0, 'format'
          2        SEND_VAL_EX                                              'Y-m-d'
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   21     5*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.7 ms | 1001 KiB | 16 Q