3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dateSuffix(int $day): string { return [ 1 => 'st', 2 => 'nd', 3 => 'rd', 21 => 'st', 22 => 'nd', 23 => 'rd', 31 => 'st' ][$day] ?? 'th'; } echo "4" . dateSuffix(4);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/quOIA
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'datesuffix'
          1        SEND_VAL                                                 4
          2        DO_FCALL                                      0  $0      
          3        CONCAT                                           ~1      '4', $0
          4        ECHO                                                     ~1
          5      > RETURN                                                   1

Function datesuffix:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/quOIA
function name:  dateSuffix
number of ops:  8
compiled vars:  !0 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_IS                                     ~1      <array>, !0
          2        COALESCE                                         ~2      ~1
          3        QM_ASSIGN                                        ~2      'th'
          4        VERIFY_RETURN_TYPE                                       ~2
          5      > RETURN                                                   ~2
    5     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function datesuffix

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.37 ms | 999 KiB | 14 Q