3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); class CustomDateTimeImmutable extends DateTimeImmutable { public function test(): self { return CustomDateTimeImmutable::createFromInterface(new DateTime()); } public function fromFormat(): CustomDateTimeImmutable|false { return CustomDateTimeImmutable::createFromFormat('H:i:s', '00:00:00'); } } var_dump(get_class((new CustomDateTimeImmutable())->test())); //string(23) "CustomDateTimeImmutable" var_dump(get_class((new CustomDateTimeImmutable())->fromFormat())); //string(23) "CustomDateTimeImmutable"
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oBrlZ
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                                   'var_dump'
          1        NEW                                                  $0      'CustomDateTimeImmutable'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $0, 'test'
          4        DO_FCALL                                          0  $2      
          5        GET_CLASS                                            ~3      $2
          6        SEND_VAL                                                     ~3
          7        DO_ICALL                                                     
   21     8        INIT_FCALL                                                   'var_dump'
          9        NEW                                                  $5      'CustomDateTimeImmutable'
         10        DO_FCALL                                          0          
         11        INIT_METHOD_CALL                                             $5, 'fromFormat'
         12        DO_FCALL                                          0  $7      
         13        GET_CLASS                                            ~8      $7
         14        SEND_VAL                                                     ~8
         15        DO_ICALL                                                     
   22    16      > RETURN                                                       1

Class CustomDateTimeImmutable:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oBrlZ
function name:  test
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                      'CustomDateTimeImmutable', 'createFromInterface'
          1        NEW                                                  $0      'DateTime'
          2        DO_FCALL                                          0          
          3        SEND_VAR_NO_REF_EX                                           $0
          4        DO_FCALL                                          0  $2      
          5        VERIFY_RETURN_TYPE                                           $2
          6      > RETURN                                                       $2
   10     7*       VERIFY_RETURN_TYPE                                           
          8*     > RETURN                                                       null

End of function test

Function fromformat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oBrlZ
function name:  fromFormat
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   INIT_STATIC_METHOD_CALL                                      'CustomDateTimeImmutable', 'createFromFormat'
          1        SEND_VAL_EX                                                  'H%3Ai%3As'
          2        SEND_VAL_EX                                                  '00%3A00%3A00'
          3        DO_FCALL                                          0  $0      
          4        VERIFY_RETURN_TYPE                                           $0
          5      > RETURN                                                       $0
   15     6*       VERIFY_RETURN_TYPE                                           
          7*     > RETURN                                                       null

End of function fromformat

End of class CustomDateTimeImmutable.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
131.54 ms | 482 KiB | 8 Q