peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.33k stars 202 forks source link

exception expected when passing non-object to `object` typed parameter #1025

Closed jakubmisek closed 2 years ago

jakubmisek commented 2 years ago

when passing values to arguments typed as object, the behavior is unexpected.

<?php

function f(object $o) {  }
$a = 123;
f($a);

$f = "f";
$f($a);

Actual:

Expected: