Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tallaljamshed's avatar

array_keys() expects parameter 1 to be array, null given

Im getting this error when changing stripe subscription, and cashier is being used here. Now I guess this error is not with cashier or strip but here is the line with error.(within StripeObject.php)

$removed = new Util\Set(\array_diff(\array_keys($this->_values), \array_keys($values)));

although i tested this with dd() and it displays data fine. so i have no idea why it would throw an error outside dd(). if composer.json file helps ?

{
    "require": {
        "php": "^7.2",
        "barryvdh/laravel-debugbar": "*",
        "barryvdh/laravel-dompdf": "*",
        "binarytorch/larecipe": "^2.2",
        "brotzka/laravel-dotenv-editor": "^2.1",
        "consoletvs/charts": "6.*",
        "cviebrock/eloquent-sluggable": "*",
        "fideloper/proxy": "^4.0",
        "guzzlehttp/guzzle": "*",
        "kalnoy/nestedset": "5.0",
        "kingflamez/laravelrave": "^2.0",
        "kris/laravel-form-builder": "1.*",
        "laravel/cashier": "^9.0",
        "laravel/framework": "^6.0",
        "laravel/passport": "^7.0",
        "laravel/telescope": "^2.0",
        "laravel/tinker": "^1.0",
        "laravelcollective/html": "^6.1",
        "maatwebsite/excel": "^3.1.19",
        "paypal/rest-api-sdk-php": "^1.14",
        "pragmarx/countries": "*",
        "sarfraznawaz2005/visitlog": "^1.2",
        "unicodeveloper/laravel-paystack": "^1.0",
        "unisharp/laravel-filemanager": "^1.8"
    },
    "require-dev": {
        "facade/ignition": "^1.4",
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "~1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^8.0"
    },

PS: what r these "" for in \array_keys($values) ?

0 likes
1 reply
sr57's avatar

Please show us dd($this->_values) and dd($values)

Please or to participate in this conversation.