3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace Foo\Bar; trait Baz { } final class Xyz { private function __construct() { } public static function getNamespace() { return 'Bar'; } } namespace Drupal\Tests; // In order to manage different method signatures between PHPUnit versions, we // dynamically load a compatibility trait dependent on the PHPUnit runner // version. if (!trait_exists(PhpunitVersionDependentTestCompatibilityTrait::class, FALSE)) { class_alias("Foo\\" . \Foo\Bar\Xyz::getNamespace() . "\Baz", PhpunitVersionDependentTestCompatibilityTrait::class); } /** * Makes Drupal's test API forward compatible with multiple versions of PHPUnit. */ trait PhpunitCompatibilityTrait { use PhpunitVersionDependentTestCompatibilityTrait; } $ref = new \ReflectionClass(PhpunitCompatibilityTrait::class); var_dump($ref->getStartLine());
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/5HOOW
function name:  (null)
number of ops:  25
compiled vars:  !0 = $ref
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   INIT_NS_FCALL_BY_NAME                                        'Drupal%5CTests%5Ctrait_exists'
          1        SEND_VAL_EX                                                  'Drupal%5CTests%5CPhpunitVersionDependentTestCompatibilityTrait'
          2        SEND_VAL_EX                                                  <false>
          3        DO_FCALL                                          0  $1      
          4        BOOL_NOT                                             ~2      $1
          5      > JMPZ                                                         ~2, ->14
   23     6    >   INIT_NS_FCALL_BY_NAME                                        'Drupal%5CTests%5Cclass_alias'
          7        INIT_STATIC_METHOD_CALL                                      'Foo%5CBar%5CXyz', 'getNamespace'
          8        DO_FCALL                                          0  $3      
          9        CONCAT                                               ~4      'Foo%5C', $3
         10        CONCAT                                               ~5      ~4, '%5CBaz'
         11        SEND_VAL_EX                                                  ~5
         12        SEND_VAL_EX                                                  'Drupal%5CTests%5CPhpunitVersionDependentTestCompatibilityTrait'
         13        DO_FCALL                                          0          
   29    14    >   DECLARE_CLASS                                                'drupal%5Ctests%5Cphpunitcompatibilitytrait'
   33    15        NEW                                                  $7      'ReflectionClass'
         16        SEND_VAL_EX                                                  'Drupal%5CTests%5CPhpunitCompatibilityTrait'
         17        DO_FCALL                                          0          
         18        ASSIGN                                                       !0, $7
   34    19        INIT_NS_FCALL_BY_NAME                                        'Drupal%5CTests%5Cvar_dump'
         20        INIT_METHOD_CALL                                             !0, 'getStartLine'
         21        DO_FCALL                                          0  $10     
         22        SEND_VAR_NO_REF_EX                                           $10
         23        DO_FCALL                                          0          
         24      > RETURN                                                       1

Class Foo\Bar\Baz: [no user functions]
Class Foo\Bar\Xyz:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5HOOW
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                       null

End of function __construct

Function getnamespace:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5HOOW
function name:  getNamespace
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                       'Bar'
   14     1*     > RETURN                                                       null

End of function getnamespace

End of class Foo\Bar\Xyz.

Class Drupal\Tests\PhpunitCompatibilityTrait: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.86 ms | 1968 KiB | 16 Q