In PHP7 new MongoId() is not working and solution to get mongo id in php7 using below function var_dump(new MongoDB\BSON\ObjectId())
, but I am using this in multiple files almost more than 200 files so I don't want manually edit all these files.
So can anybody tell me is there any trick like using __autolaod(),spl_autoload_register()
function so we can add some code and that will will automatically called for new MongoId()
function and return the mongoID without an error.
I just need a smart solution without editing multiple files.