3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pages = [ 'a' => ['title' => 'A'], 'c' => ['title' => 'C'], 'b' => ['title' => 'B'], 'n' => ['title' => '.N'], ]; uasort($pages, fn($a, $b) => preg_replace('_^[^0-9a-z]*_', '', strtolower($a['title'])) <=> preg_replace('_^[^0-9a-z]*_', '', strtolower($b['title'])) ); echo implode(', ', array_map(fn($page) => $page['title'], $pages));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/haMbs
function name:  (null)
number of ops:  17
compiled vars:  !0 = $pages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'uasort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   12     4        SEND_VAL                                                 ~2
   10     5        DO_ICALL                                                 
   14     6        INIT_FCALL                                               'implode'
          7        SEND_VAL                                                 '%2C+'
          8        INIT_FCALL                                               'array_map'
          9        DECLARE_LAMBDA_FUNCTION                          ~4      [1]
         10        SEND_VAL                                                 ~4
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                         $6      
         15        ECHO                                                     $6
         16      > 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/haMbs
function name:  {closure}
number of ops:  23
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '_%5E%5B%5E0-9a-z%5D%2A_'
          4        SEND_VAL                                                 ''
          5        INIT_FCALL                                               'strtolower'
          6        FETCH_DIM_R                                      ~2      !0, 'title'
          7        SEND_VAL                                                 ~2
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                         $4      
         11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '_%5E%5B%5E0-9a-z%5D%2A_'
         13        SEND_VAL                                                 ''
         14        INIT_FCALL                                               'strtolower'
         15        FETCH_DIM_R                                      ~5      !1, 'title'
         16        SEND_VAL                                                 ~5
         17        DO_ICALL                                         $6      
         18        SEND_VAR                                                 $6
         19        DO_ICALL                                         $7      
         20        SPACESHIP                                        ~8      $4, $7
         21      > RETURN                                                   ~8
   12    22*     > 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/haMbs
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $page
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 'title'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.87 ms | 1020 KiB | 18 Q