3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); trait UiHelperTrait { public function drupalGet(string $url): string { return '<html><body><h1>Something</h1></body></html>'; } } class BrowserTestBase { use UiHelperTrait; } class OverrideTraitMethodSignatureInChildClassTest extends BrowserTestBase { public function drupalGet(string $url): int { return 200; } } $test = new OverrideTraitMethodSignatureInChildClassTest(); var_dump($test->drupalGet('https://drupal.org'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8RLDn
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'browsertestbase'
   17     1        DECLARE_CLASS                                            'overridetraitmethodsignatureinchildclasstest', 'browsertestbase'
   25     2        NEW                                              $1      'OverrideTraitMethodSignatureInChildClassTest'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   26     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'drupalGet'
          7        SEND_VAL_EX                                              'https%3A%2F%2Fdrupal.org'
          8        DO_FCALL                                      0  $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class UiHelperTrait:
Function drupalget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8RLDn
function name:  drupalGet
number of ops:  4
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1      > RETURN                                                   '%3Chtml%3E%3Cbody%3E%3Ch1%3ESomething%3C%2Fh1%3E%3C%2Fbody%3E%3C%2Fhtml%3E'
    9     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function drupalget

End of class UiHelperTrait.

Class BrowserTestBase: [no user functions]
Class OverrideTraitMethodSignatureInChildClassTest:
Function drupalget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8RLDn
function name:  drupalGet
number of ops:  4
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1      > RETURN                                                   200
   21     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function drupalget

End of class OverrideTraitMethodSignatureInChildClassTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.68 ms | 998 KiB | 14 Q