3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ordinalFormatter = new NumberFormatter('en', NumberFormatter::ORDINAL); $numbers = range(1, 30); $ordinals = []; array_walk($numbers, function ($number) use ($ordinalFormatter, $ordinals) { $ordinals[] = $ordinalFormatter->format($number); }); printf("Ordinals: %s\n", implode(', ', $ordinals));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cf9JE
function name:  (null)
number of ops:  28
compiled vars:  !0 = $ordinalFormatter, !1 = $numbers, !2 = $ordinals
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'NumberFormatter'
          1        SEND_VAL_EX                                              'en'
          2        FETCH_CLASS_CONSTANT                             ~4      'NumberFormatter', 'ORDINAL'
          3        SEND_VAL_EX                                              ~4
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
    5     6        INIT_FCALL                                               'range'
          7        SEND_VAL                                                 1
          8        SEND_VAL                                                 30
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
    6    11        ASSIGN                                                   !2, <array>
    8    12        INIT_FCALL                                               'array_walk'
         13        SEND_REF                                                 !1
         14        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fcf9JE%3A8%240'
         15        BIND_LEXICAL                                             ~10, !0
         16        BIND_LEXICAL                                             ~10, !2
   10    17        SEND_VAL                                                 ~10
         18        DO_ICALL                                                 
   12    19        INIT_FCALL                                               'printf'
         20        SEND_VAL                                                 'Ordinals%3A+%25s%0A'
         21        INIT_FCALL                                               'implode'
         22        SEND_VAL                                                 '%2C+'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $12     
         25        SEND_VAR                                                 $12
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fcf9JE%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cf9JE
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $number, !1 = $ordinalFormatter, !2 = $ordinals
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
    9     3        INIT_METHOD_CALL                                         !1, 'format'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $4      
          6        ASSIGN_DIM                                               !2
          7        OP_DATA                                                  $4
   10     8      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fcf9JE%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.04 ms | 1396 KiB | 21 Q