3v4l.org

run code in 300+ PHP versions simultaneously
<?php $formatter = new IntlDateFormatter( 'ja_JP@calendar=japanese', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'Europe/Madrid', IntlDateFormatter::TRADITIONAL, 'Gy年M月' ); $str = "令和元年8月"; $new = mb_ereg_replace($str , "令和元年" , "2019年"); echo $new; $ts = $formatter->parse($new); //$ts = $formatter->parse('令和元年8月'); var_dump($ts, date('Y-m', $ts));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tt41F1
function name:  (null)
number of ops:  33
compiled vars:  !0 = $formatter, !1 = $str, !2 = $new, !3 = $ts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'IntlDateFormatter'
    4     1        SEND_VAL_EX                                              'ja_JP%40calendar%3Djapanese'
    5     2        FETCH_CLASS_CONSTANT                             ~5      'IntlDateFormatter', 'FULL'
          3        SEND_VAL_EX                                              ~5
    6     4        FETCH_CLASS_CONSTANT                             ~6      'IntlDateFormatter', 'FULL'
          5        SEND_VAL_EX                                              ~6
    7     6        SEND_VAL_EX                                              'Europe%2FMadrid'
    8     7        FETCH_CLASS_CONSTANT                             ~7      'IntlDateFormatter', 'TRADITIONAL'
          8        SEND_VAL_EX                                              ~7
    9     9        SEND_VAL_EX                                              'Gy%E5%B9%B4M%E6%9C%88'
         10        DO_FCALL                                      0          
    3    11        ASSIGN                                                   !0, $4
   11    12        ASSIGN                                                   !1, '%E4%BB%A4%E5%92%8C%E5%85%83%E5%B9%B48%E6%9C%88'
   12    13        INIT_FCALL                                               'mb_ereg_replace'
         14        SEND_VAR                                                 !1
         15        SEND_VAL                                                 '%E4%BB%A4%E5%92%8C%E5%85%83%E5%B9%B4'
         16        SEND_VAL                                                 '2019%E5%B9%B4'
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !2, $11
   13    19        ECHO                                                     !2
   14    20        INIT_METHOD_CALL                                         !0, 'parse'
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0  $13     
         23        ASSIGN                                                   !3, $13
   19    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !3
         26        INIT_FCALL                                               'date'
         27        SEND_VAL                                                 'Y-m'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $15     
         30        SEND_VAR                                                 $15
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.1 ms | 1388 KiB | 19 Q