1--TEST-- 2Test that the mixed property type accepts any kind of value in weak mode 3--FILE-- 4<?php 5 6class Foo 7{ 8 public mixed $property1; 9 public mixed $property2 = null; 10 public mixed $property3 = false; 11 public mixed $property4 = true; 12 public mixed $property5 = 1; 13 public mixed $property6 = 3.14; 14 public mixed $property7 = "foo"; 15 public mixed $property8 = []; 16 public mixed $property9; 17 18 public function __construct() 19 { 20 $this->property9 = fopen(__FILE__, "r"); 21 $this->property9 = new stdClass(); 22 } 23} 24 25$foo = new Foo(); 26 27try { 28 $foo->property1; 29} catch (Error $exception) { 30 echo $exception->getMessage() . "\n"; 31} 32 33?> 34--EXPECT-- 35Typed property Foo::$property1 must not be accessed before initialization 36