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))->format("Y-m-d"); }, $input ); sort($dates); var_dump($dates);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m5hd9
function name:  (null)
number of ops:  14
compiled vars:  !0 = $input, !1 = $dates
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                                  '%00%7Bclosure%7D%2Fin%2Fm5hd9%3A10%240'
   12     3        SEND_VAL                                                 ~3
   13     4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
    9     6        ASSIGN                                                   !1, $4
   16     7        INIT_FCALL                                               'sort'
          8        SEND_REF                                                 !1
          9        DO_ICALL                                                 
   18    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fm5hd9%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m5hd9
function name:  {closure}
number of ops:  9
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        INIT_METHOD_CALL                                         $1, 'format'
          5        SEND_VAL_EX                                              'Y-m-d'
          6        DO_FCALL                                      0  $3      
          7      > RETURN                                                   $3
   12     8*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
196.7 ms | 1395 KiB | 19 Q