3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo\Bar; trait Baz { } 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)) { $x = 'Bar'; class_alias("Foo\\$x\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/8gRAB
function name:  (null)
number of ops:  25
compiled vars:  !0 = $x, !1 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     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  $2      
          4        BOOL_NOT                                         ~3      $2
          5      > JMPZ                                                     ~3, ->14
   15     6    >   ASSIGN                                                   !0, 'Bar'
   16     7        INIT_NS_FCALL_BY_NAME                                    'Drupal%5CTests%5Cclass_alias'
          8        ROPE_INIT                                     3  ~6      'Foo%5C'
          9        ROPE_ADD                                      1  ~6      ~6, !0
         10        ROPE_END                                      2  ~5      ~6, '%5CBaz'
         11        SEND_VAL_EX                                              ~5
         12        SEND_VAL_EX                                              'Drupal%5CTests%5CPhpunitVersionDependentTestCompatibilityTrait'
         13        DO_FCALL                                      0          
   22    14    >   DECLARE_CLASS                                            'drupal%5Ctests%5Cphpunitcompatibilitytrait'
   26    15        NEW                                              $9      'ReflectionClass'
         16        SEND_VAL_EX                                              'Drupal%5CTests%5CPhpunitCompatibilityTrait'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !1, $9
   27    19        INIT_NS_FCALL_BY_NAME                                    'Drupal%5CTests%5Cvar_dump'
         20        INIT_METHOD_CALL                                         !1, 'getStartLine'
         21        DO_FCALL                                      0  $12     
         22        SEND_VAR_NO_REF_EX                                       $12
         23        DO_FCALL                                      0          
         24      > RETURN                                                   1

Class Foo\Bar\Baz: [no user functions]
Class Drupal\Tests\PhpunitCompatibilityTrait: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.84 ms | 1395 KiB | 19 Q