assign_036.phpt 916 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. JIT ASSIGN: Assign with INTERNED string(no RC)
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.file_update_protection=0
  7. opcache.jit_buffer_size=1M
  8. opcache.protect_memory=1
  9. ;opcache.jit_debug=257
  10. --EXTENSIONS--
  11. opcache
  12. --FILE--
  13. <?php
  14. class A {
  15. public $result = "string";
  16. function __set($propName, $propValue)
  17. {
  18. $oldType = \gettype($this->$propName);
  19. $newType = \gettype($propValue);
  20. if ($propValue === 'false')
  21. {
  22. $newType = 'boolean';
  23. $propValue = \false;
  24. }
  25. elseif ($propValue === 'true')
  26. {
  27. $newType = 'boolean';
  28. $propValue = \true;
  29. }
  30. if ($oldType !== $newType)
  31. {
  32. $tmp = $propValue;
  33. \settype($tmp, $newType);
  34. }
  35. $this->propName = $propValue;
  36. }
  37. }
  38. $a = new A;
  39. $a->result = "okey";
  40. echo $a->result;
  41. ?>
  42. --EXPECT--
  43. okey