Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Fatal errorの解決方法 #1

@almatelia

Description

@almatelia

PHPでmbaasのデータストアに登録をしたいと思い、php-ncmbを使って登録しようとしましたが、エラーが出てきました。解決方法の検討をよろしくおねがいします。

###test.php

<?php

require 'vendor/autoload.php';

use Ncmb\NCMB;
use Ncmb\Object;
$appKey    ='794989f6e7e6a55fc6c21a079846453b40eae2425cb866a3c7ccc4625e6861b2';
$clientKey ='5a73aed2f40bf1d96b0a97ea70e408414723cc546b1bd5c9f2f71fe728f31eef';
NCMB::initialize($appKey,$clientKey);

$className = 'Friends';
$friend = new Object($className);
$friend->name = 'サーバルちゃん';
$friend->phrase = 'たーのしー';
$friend->save();

?>

###エラー内容

Fatal error: Cannot use Ncmb\Object as Object because 'Object' is a special class name in C:\xampp\htdocs\iot2\com\test.php on line 7

###使用
composer v1.6.5
xampp v3.2.2
php-ncmb v0.1.1

###参考
https://github.com/NCMBMania/php-ncmb
https://packagist.org/packages/ncmbmania/php-ncmb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions