bug74442.phpt 853 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. Bug #74442: Opcached version produces a nested array
  3. --CREDITS--
  4. Eric Norris <erictnorris@gmail.com>
  5. --EXTENSIONS--
  6. opcache
  7. --FILE--
  8. <?php
  9. class Schema_Base {
  10. public function addField($typeclass, array $params = null) {
  11. $field = new $typeclass($params);
  12. return $field;
  13. }
  14. }
  15. class Field_Base {
  16. public function __construct(array $params = null) {
  17. if (! is_array($params)) {
  18. $params = (array) $params;
  19. }
  20. call_user_func_array(array($this, 'acceptParams'), $params);
  21. }
  22. }
  23. class Field_Integer extends Field_Base {
  24. protected function acceptParams($bytes = 4) {
  25. echo print_r($bytes, true);
  26. }
  27. }
  28. try {
  29. $schema = new Schema_Base;
  30. $schema->addField('Field_Integer');
  31. } catch (Throwable $ex) {
  32. echo "CAUGHT EXCEPTION";
  33. echo (string)$ex;
  34. }
  35. ?>
  36. --EXPECT--
  37. 4