Parameter uses ‘parent’ as type hint although class does not have a parent!

Description

This error is a Reflection API error. It appears when the code tries to get information about the type of a parameter, that was defined as ‘parent’ while it is not a valid code.

Example

<?php

class X {
     function foo(parent $a) {}
}

?>

Solutions

  • Check the name of the type before trying to instantiate it.