3v4l.org

run code in 500+ PHP versions simultaneously
<?php $round = new \NumberFormatter("en", \NumberFormatter::ORDINAL); var_dump($round->format(6)); // OUTPUTS 6th $round = new \NumberFormatter("en", \NumberFormatter::ORDINAL); var_dump($round->parse("6th")); // OUTPUTS float 122!!! var_dump($round->getErrorMessage()); // ZERO ERROR
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hLYvp
function name:  (null)
number of ops:  30
compiled vars:  !0 = $round
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $1      'NumberFormatter'
          1        SEND_VAL_EX                                                  'en'
          2        FETCH_CLASS_CONSTANT                                 ~2      'NumberFormatter', 'ORDINAL'
          3        SEND_VAL_EX                                                  ~2
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !0, $1
    4     6        INIT_FCALL                                                   'var_dump'
          7        INIT_METHOD_CALL                                             !0, 'format'
          8        SEND_VAL_EX                                                  6
          9        DO_FCALL                                          0  $5      
         10        SEND_VAR                                                     $5
         11        DO_ICALL                                                     
    6    12        NEW                                                  $7      'NumberFormatter'
         13        SEND_VAL_EX                                                  'en'
         14        FETCH_CLASS_CONSTANT                                 ~8      'NumberFormatter', 'ORDINAL'
         15        SEND_VAL_EX                                                  ~8
         16        DO_FCALL                                          0          
         17        ASSIGN                                                       !0, $7
    7    18        INIT_FCALL                                                   'var_dump'
         19        INIT_METHOD_CALL                                             !0, 'parse'
         20        SEND_VAL_EX                                                  '6th'
         21        DO_FCALL                                          0  $11     
         22        SEND_VAR                                                     $11
         23        DO_ICALL                                                     
    8    24        INIT_FCALL                                                   'var_dump'
         25        INIT_METHOD_CALL                                             !0, 'getErrorMessage'
         26        DO_FCALL                                          0  $13     
         27        SEND_VAR                                                     $13
         28        DO_ICALL                                                     
         29      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.44 ms | 3348 KiB | 14 Q