print_001.phpt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. --TEST--
  2. Basic print functionality
  3. --INI--
  4. opcache.enable_cli=0
  5. --PHPDBG--
  6. p foo
  7. p class \Foo\bar
  8. p
  9. p e
  10. q
  11. --EXPECTF--
  12. [Successful compilation of %s]
  13. prompt> [User Function foo (8 ops)]
  14. foo:
  15. ; (lines=8, args=1, vars=1, tmps=2)
  16. ; %s:14-16
  17. L0014 0000 CV0($baz) = RECV 1
  18. L0015 0001 INIT_FCALL %d %d string("var_dump")
  19. L0015 0002 INIT_FCALL %d %d string("strrev")
  20. L0015 0003 SEND_VAR CV0($baz) 1
  21. L0015 0004 V1 = DO_ICALL
  22. L0015 0005 SEND_VAR V1 1
  23. L0015 0006 DO_ICALL
  24. L0016 0007 RETURN null
  25. prompt> [User Class: Foo\Bar (2 methods)]
  26. Foo\Bar::Foo:
  27. ; (lines=5, args=1, vars=1, tmps=1)
  28. ; %s:5-7
  29. L0005 0000 CV0($bar) = RECV 1
  30. L0006 0001 INIT_NS_FCALL_BY_NAME 1 string("Foo\var_dump")
  31. L0006 0002 SEND_VAR_EX CV0($bar) 1
  32. L0006 0003 DO_FCALL
  33. L0007 0004 RETURN null
  34. Foo\Bar::baz:
  35. ; (lines=1, args=0, vars=0, tmps=0)
  36. ; %s:9-9
  37. L0009 0000 RETURN null
  38. prompt> [Not Executing!]
  39. prompt> [Context %s (9 ops)]
  40. $_main:
  41. ; (lines=9, args=0, vars=0, tmps=4)
  42. ; %s:1-21
  43. L0018 0000 V0 = NEW 0 string("Foo\Bar")
  44. L0018 0001 DO_FCALL
  45. L0018 0002 INIT_METHOD_CALL 1 V0 string("Foo")
  46. L0018 0003 SEND_VAL_EX string("test") 1
  47. L0018 0004 DO_FCALL
  48. L0019 0005 INIT_FCALL %d %d string("foo")
  49. L0019 0006 SEND_VAL string("test") 1
  50. L0019 0007 DO_FCALL
  51. L0021 0008 RETURN int(1)
  52. prompt>
  53. --FILE--
  54. <?php
  55. namespace Foo {
  56. class Bar {
  57. function Foo($bar) {
  58. var_dump($bar);
  59. }
  60. function baz() { }
  61. }
  62. }
  63. namespace {
  64. function foo($baz) {
  65. var_dump(strrev($baz));
  66. }
  67. (new \Foo\Bar)->Foo("test");
  68. foo("test");
  69. }